import { createBrowserRouter } from "react-router-dom";
import { MainLayout } from "../layouts/index";
import Home from "../views/home/home";
import About from "../views/about/about";
import Setting from "../views/user/setting/setting";
import Login from "../views/user/login/login";

export const router = createBrowserRouter([
  {
    path: "/",
    element: <MainLayout />,
    children: [
      {
        path: "main",
        element: <Home />,
      },
      {
        path: "react-app/*", // 微前端需要
        element: <About />,
      },
      {
        path: "user",
        children: [{ path: "setting", element: <Setting /> }],
      }
    ],
  },
  {
    path: "/login",
    element: <Login />,
  },
]);
